import React from "react";

export class Demo extends React.Component {
  state = {
    isHot: false
  }

  changeWeather = (hot) => {
    this.setState({
      isHot: !hot
    })
  }
  render() {
    console.log(this);
    return (
      <div>
        <h3 onClick={()=>this.changeWeather(this.state.isHot)}>今天天气很{this.state.isHot? '炎热' : '凉爽'}</h3>
      </div>
    )
  }
}